package com.gooluke.redis.uitl;

import org.apache.commons.lang3.ObjectUtils;

import java.util.Objects;

/**
 * @author gooluke
 * description
 * datetime 2025-04-01 23:10
 */
public class AssertUtil {

    public static void isTrue(boolean expression, String errMsg) {
        if (!expression) {
            throw new RuntimeException(errMsg);
        }
    }

    public static void notNull(Object object, String errMsg) {
        if (Objects.isNull(object)) {
            throw new RuntimeException(errMsg);
        }
    }

    public static void notEmpty(Object object, String errMsg) {
        if (ObjectUtils.isEmpty(object)) {
            throw new RuntimeException(errMsg);
        }
    }

}
